<?php
defined('BASEPATH') or exit('No direct script access allowed');

class Test extends CI_Controller
{
    public function __construct()
    {
        parent::__construct();
        $this->load->helper('crossdomain');
        $this->load->model('libs/odb', 'odb');
        $this->load->helper('cookie');
        $this->load->library('session');
        cross_domain();//跨域设置header
    }



    public function index()
    {
        echo "hello yaner bady";
    }
    

    public function uuid()
    { 
       function uuid()
        {
            $chars = md5(uniqid(mt_rand(), true));
            $uuid = substr($chars, 0, 8) . '-'
            . substr($chars, 8, 4) . '-'
            . substr($chars, 12, 4) . '-'
            . substr($chars, 16, 4) . '-'
            . substr($chars, 20, 12);
            return $chars ;
        }
 
        echo  uuid();  //Returns like 'dba5ce3e-430f-cf1f-8443-9b337cb5f7db'
    }
}///class
